package io.zhiller.simpletemplate.utils.vanilla

import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.Composable
import com.maxkeppeker.sheets.core.models.base.Header
import com.maxkeppeker.sheets.core.models.base.rememberUseCaseState
import com.maxkeppeler.sheets.info.InfoDialog
import com.maxkeppeler.sheets.info.models.InfoBody
import com.maxkeppeler.sheets.info.models.InfoSelection

object DialogUtils {
  @OptIn(ExperimentalMaterial3Api::class)
  @Composable
  fun DialogInfoComp(
    title: String = "Title",
    content: String = "body",
    onDismiss: () -> Unit = {},
    onSuccess: () -> Unit = {}
  ) {
    InfoDialog(
      state = rememberUseCaseState(visible = true, onCloseRequest = { onDismiss() }),
      header = Header.Default(
        title = title,
      ),
      body = InfoBody.Default(bodyText = content, postBody = {}),
      selection = InfoSelection(
        onPositiveClick = onSuccess, onNegativeClick = onDismiss
      ),
    )
  }
}